//
//  ProductListViewCell.m
//  Tiger
//
//  Created by Ken on 11-10-18.
//  Copyright 2011 __MyCompanyName__. All rights reserved.
//

#import "ProductListViewCell.h"
#import "AsyncImageView.h"

@implementation ProductListViewCell
@synthesize productName;
@synthesize productNameEn;

- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {

        UIImageView* cellbg = [[UIImageView alloc] initWithFrame:self.frame];
        [cellbg setImage:[UIImage imageNamed:@"plistbg"]];
        [self.contentView addSubview:cellbg];
        [cellbg release];
        
		productNameLabel = [[UILabel alloc] initWithFrame:CGRectMake(10, 8, 170, 42)];
		productNameLabel.baselineAdjustment = UIBaselineAdjustmentAlignCenters;
		productNameLabel.lineBreakMode = UILineBreakModeWordWrap;
		productNameLabel.numberOfLines = 2;
		productNameLabel.font = [UIFont boldSystemFontOfSize:17];
		productNameLabel.textColor = [UIColor lightGrayColor];
		productNameLabel.backgroundColor = [UIColor clearColor];
		[self.contentView addSubview:productNameLabel];
		
		productNameEnLabel = [[UILabel alloc] initWithFrame:CGRectMake(10, 42, 260, 35)];
		productNameEnLabel.baselineAdjustment = UIBaselineAdjustmentAlignCenters;
		productNameEnLabel.lineBreakMode = UILineBreakModeWordWrap;
		productNameEnLabel.numberOfLines = 2;
		productNameEnLabel.font = [UIFont systemFontOfSize:11];
		productNameEnLabel.textColor = [UIColor grayColor];
		productNameEnLabel.backgroundColor = [UIColor clearColor];
		[self.contentView addSubview:productNameEnLabel];
    }
    return self;
}


#pragma mark Properties Methods

- (NSString *)productName { return productNameLabel.text; }
- (void)setProductName:(NSString *)d { productNameLabel.text = d; }


- (NSString *)productNameEn { return productNameEnLabel.text; }
- (void)setProductNameEn:(NSString *)d { productNameEnLabel.text = d; }


- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    
    [super setSelected:selected animated:animated];
    
    // Configure the view for the selected state.
}

- (void)dealloc {
	[productNameLabel release];
	[productNameEnLabel release];
    [super dealloc];
}


@end
